/*
 * @Author: huangwei
 * @Date: 2021-05-14 17:13:42
 * @LastEditors: 黄威
 * @LastEditTime: 2021-10-28 12:02:34
 * @Description: 绘画用的mixin
 */
import { Component } from 'vue-property-decorator'

import L from 'leaflet'
import LDraw from '@/utils/draw/LDraw'
import { LGraphicLayer } from '@/utils/bind-map/graphic'

import BaseDrawMixin from '../BindMap/BaseDrawMixin'

@Component
export default class DrawMixin extends BaseDrawMixin<LDraw, LGraphicLayer> {
    _initDrawMixin(map: L.Map) {
        this.drawIns = new LDraw(map)
        this.drawLayer = new LGraphicLayer(this as any)
        this._initTip(map.getContainer(), 'mgs-l-map-tip')
    }

    newGraphicLayer() {
        return new LGraphicLayer(this as any)
    }
}
